from Components.Component import Component

class StackAdd(Component):

  def __call__(self, values):
    #for key in values:
    #   values[key] = values[key] + 1
    
    assert 'stack' in values.keys()    # StackAdd(Component) needs 'stack' to run 
    a = values['stack'].pop()
    b = values['stack'].pop()
    
    values['stack'].append( int(a) + int(b) )

    return (([self.get_connection()], values),)
